<%--
  Created by IntelliJ IDEA.
  User: hbl
  Date: 2017/6/7
  Time: 14:53
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>个人中心</title>
    <c:if test="${!empty message}">
        <script language="javascript">
            alert("您的内容已经提交");
        </script>
    </c:if>
    <style>
        .outLgin{
            position: absolute;
            width: 100px;
            background-color: cadetblue;
            border-radius: 20px;
            margin-top: 10%;
            margin-left: 50%;
            color: black;
            opacity: 0.9;
            z-index: 99;
        }
    </style>
</head>
<link href="/resources/css/student.css" rel="stylesheet">
<link href="/resources/css/hesder.css" rel="stylesheet">
<script src="/resources/js/jquery-2.1.0.js"></script>

<body>
    <div id="header">
        <div><a href="../../index.jsp">首页</a></div><div>社区</div><div><a href="http://localhost:8080/File/pager">资料共享</a></div><div>个人中心</div>
    </div>
    <div class="img2"></div>
    <div class="img">
        <div class="cricle">
            <img id="head" style="width: 100px ;height: 100px; border-radius: 50px" src="<%=request.getContextPath()%>/resources/files/USER-head.png">
        </div>
        <div class="info">
               <h1> ${student.username}</h1>
                <p> ${student.usernickname}</p>
                <p> ${student.usernumber}</p>
                <p>
                    <c:if test="${empty student.sign}">这位同学很懒，木有签名的说～</c:if>
                    <c:if test="${!empty student.sign}">${student.sign}</c:if>

        </div>

        <a href="http://localhost:8080/Student/logout"><input type="button" class="outLgin" value="退出登陆"/></a>

    </div>

    <div class="left">

        <div class="next setting">
             个人设置
        </div>
        <div class="next files">
            资料管理
        </div>
        <div class="next">
            个人简介管理
        </div>
        <div class="next">
            消息
        </div>

    </div>
    <div class="right">

    </div>

    <script>
        $(function(){
            $.ajax("http://localhost:8080/Image/get",{
                type:"get",
                data:{
                },
                success:function(data){
                    console.log(data);
                    var dataObj = eval('('+data+')');
                    var arr = dataObj.imgurl.split("\\");
                    var src = "http://localhost:8080/resources/"+arr[arr.length-2]+"/"+arr[arr.length-1];
                    console.log("?????????????????????"+src)
                    setBg(src);
                },
                error:function(){
                    alert(0)
                }
            })

            function setBg(src){
                console.log(">>>>>>>>>>>>>"+src)
                $("#head").attr("src",src)
            }
            $(".right").load("setting");

            $(".setting").click(function(){
                $(".right").load("setting");
            })
            $(".files").click(function(){
                $(".right").load("files");
            })

        })



    </script>
</body>
</html>
